package com.tushare.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tushare.entity.IndexMean;
import com.tushare.mapper.IndexMeanMapper;
import com.tushare.service.IIndexMeanService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2021-03-14
 */
@Service
public class IndexMeanServiceImpl extends ServiceImpl<IndexMeanMapper, IndexMean> implements IIndexMeanService {

    @Override
    public List<IndexMean> getIndexMeanCountByTsCode(String ts_code) {
        return getBaseMapper().getIndexMeanCountByTsCode(ts_code);
    }

    @Override
    public boolean saveIndexMeans(List<IndexMean> list) {
        if (list == null || list.size() == 0) {
            return false;
        }
        return saveBatch(list);
    }

    @Override
    public boolean deleteAllIndexMean() {
        return getBaseMapper().deleteAllIndexMean();
    }
}
